package com.ms.game.common.container;

public class StringTableBinUtil extends BasicBinUtil{
	
	private static StringTableBin bin = null;
	
	@Override
	public void onBinLoad(Object binInstance) {	
		bin = (StringTableBin) binInstance;
	}
	
	/**
	 * 從string table 取值出來
	 * @param stringTableId
	 * @return
	 */
	public static String getText(String stringTableId){
		return getValueFromStringTable(stringTableId);
	}

	/**
	 * 從string table 取值出來
	 * @param stringTableId
	 * @return
	 */
	public static String getText(int stringTableId) {
		String id = String.valueOf(stringTableId);
		return getValueFromStringTable(id);
	}
	
	private static String getValueFromStringTable(String stringTableId){
		return bin.getStringMap().get(stringTableId);
	}
	
}
